package com.springbootmybatis.demo.service;

import com.springbootmybatis.demo.dao.Mapper;
import com.springbootmybatis.demo.domain.TestPOJO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * User: keer-dkx
 * date: ${Date}
 * Time：${Time}
 */
@Service
public class TestService {

    @Autowired
    private Mapper mapper;

    public String show(){
        return "hello world，uni!";
    }

    //showDao方法，参数id是自己命名定义，不影响其他，返回类型是List的自定义testPOJO
    //调用了testDao的get方法

    /**
     *
     * @param id
     * @return
     */
    public TestPOJO findByid(long id){
        return mapper.findById(id);
    }
}
